#ifndef SERVER_H
#define SERVER_H

#include <netdb.h>

#define SERVER_PORT     8888
#define MAXLINE         4096

struct cJSON;

int start_server();

int wait_for_connection(int listenfd);

void do_temphum_request(int connfd);

void do_leds_request(int connfd);

int deal_request(int connfd);

void control_leds(struct cJSON* root);

void control_fan(struct cJSON* root);


#endif // SERVER_H

